Skip tests that require Windows admin instead of fail#4757
Merged
Kielek merged 2 commits intoopen-telemetry:mainfrom Jan 15, 2026
Merged
Skip tests that require Windows admin instead of fail#4757Kielek merged 2 commits intoopen-telemetry:mainfrom
Kielek merged 2 commits intoopen-telemetry:mainfrom
Conversation
Member
Author
|
Failures look like unrelated flakes. |
Contributor
There was a problem hiding this comment.
Pull request overview
This PR improves the local development experience by skipping tests that require Windows administrator privileges instead of failing them. It introduces two new custom xUnit attributes (WindowsAdministratorFactAttribute and WindowsAdministratorTheoryAttribute) that automatically check for Windows admin privileges and skip tests when they are not available.
Changes:
- Created two new custom test attributes for xUnit that check Windows admin privileges and skip tests automatically
- Replaced
[Fact]and[Theory]attributes with the new custom attributes in tests requiring admin privileges - Removed redundant
Assert.True(EnvironmentTools.IsWindowsAdministrator(), ...)calls from test methods
Reviewed changes
Copilot reviewed 8 out of 8 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| WindowsAdministratorTheoryAttribute.cs | New custom attribute for theory tests requiring Windows admin privileges |
| WindowsAdministratorFactAttribute.cs | New custom attribute for fact tests requiring Windows admin privileges |
| WcfNetFrameworkTests.cs | Applied WindowsAdministratorFact attribute to test requiring admin privileges |
| WcfIISTests.cs | Applied WindowsAdministratorFact attribute and removed redundant assertion |
| WcfDotNetTests.cs | Applied WindowsAdministratorTheory attribute to parameterized test |
| OwinIISTests.cs | Applied WindowsAdministratorFact attribute and removed redundant assertions from two tests |
| DomainNeutralTests.cs | Applied WindowsAdministratorFact attribute and removed redundant assertion |
| AspNetTests.cs | Applied WindowsAdministratorTheory/Fact attributes and removed redundant assertions from four tests |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
RassK
approved these changes
Jan 14, 2026
nrcventura
approved these changes
Jan 14, 2026
rajkumar-rangaraj
approved these changes
Jan 14, 2026
Kielek
reviewed
Jan 15, 2026
Skip tests that require Windows admin permissions, rather than fail.
Require administrator if on Windows, rather than require administrator and Windows.
8a7b0e1 to
5b3c4fb
Compare
Kielek
approved these changes
Jan 15, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Why
Improves local development experience.
What
Skip tests that require Windows admin permissions, rather than fail.
Tests
None.
Checklist
CHANGELOG.mdis updated.Documentation is updated.New features are covered by tests.